<template>
  <div class="pro_container">
    <page-top :pro_inf="pro_inf_top"></page-top>
    <page-center :pro_inf="pro_inf_center"></page-center>
  </div>
</template>

<script>
import {request} from '../../../network/axios'
import PageTop from './proitempage/PageTop.vue'
import PageCenter from './proitempage/pagecenter/PageCenter.vue'
export default {
  name:'proqueryitem',
    data(){
    return{
      pro_id:'',
      pro_inf_top:{},
      pro_inf_center:{}
    }
  },
  created(){
    this.pro_id=this.$route.query.id;
    this.axios.get(`http://localhost:7070/pro?id=${this.pro_id}`)
    .then(res => {
      console.log(res.data[0]);
      this.pro_inf_top=res.data[0]
      this.pro_inf_center=res.data[0]
    })
    .catch(err => {
      console.log(err);
    })
    // console.log(this.pro_id);
    // request({
    //   url:'/pro/'+this.pro_id
    // }).then(res=>{
    //   console.log(res.data);
    //   this.pro_inf_top=res.data.pro_inf.base_inf
    //   this.pro_inf_center=res.data.pro_inf.pro_detail
    // }).catch(err=>{
    //   console.log(err);
    // })
  },
  components:{
    PageTop,
    PageCenter
  }
}
</script>

<style>
.pro_container{
  width: 1200px;
  margin: 10px auto;
  border: 1px solid rgba(137, 43, 226, 0.171);
}
</style>